<?php
include('../data/comm.inc.php');
include('../data/uservar.php');
include('../func/func.php');
include('../func/csfunc.php');
include('../func/userfunc.php');
include('../include.php');
include('./checklogin.php');



        $msql->query("select maxmoney,money,kmaxmoney,kmoney,pan,defaultpan,username,name,fastje,fudong,sy,layer,jzkmoney from `{$tb_user}` where userid='{$userid}'");
        $msql->next_record();
        $tpl->assign('username', $msql->f('username') . '[' . $msql->f('name') . ']');

            
                $tpl->assign('kmaxmoney', $msql->f('kmaxmoney'));
                $tpl->assign('kmoney', $msql->f('kmoney'));
				if($msql->f('kmaxmoney')==0){
                $tpl->assign('kmoneyuse', $msql->f('sy')-$msql->f('jzkmoney')- $msql->f('kmoney'));
				}else{
                $tpl->assign('kmoneyuse', $msql->f('kmaxmoney') +$msql->f('sy')-$msql->f('jzkmoney')- $msql->f('kmoney'));
				}
            
                $tpl->assign('maxmoney', $msql->f('maxmoney'));
                $tpl->assign('money', $msql->f('money'));
                $tpl->assign('moneyuse', $msql->f('maxmoney') - $msql->f('money'));
           $tpl->assign("layer",$msql->f("layer"));
       

        $gamecs = getgamecs($userid);
        $gamecs = getgamename($gamecs);
        $tpl->assign('gamecs', $gamecs);
        $tpl->assign('gid', $gid);
        $pan  = json_decode($msql->f('pan'), true);
		$tpl->assign('pan', $pan);
		$tpl->assign('cpan', count($pan));
		if($_SESSION['abcd']=='A' | $_SESSION['abcd']=='B'  | $_SESSION['abcd']=='C'  | $_SESSION['abcd']=='D' ){
		   $tpl->assign('defaultpan', $_SESSION['abcd']);
		}else{
		   $tpl->assign('defaultpan', $msql->f('defaultpan'));
		}  
        $tpl->assign('webname', $config['webname']);
        $tpl->assign('title', $config['webname'] . '-' . $msql->f('username') . '[' . $msql->f('name') . ']-' . $config['gname']);
        $tpl->assign('gname', $config['gname']);
        $tpl->assign('class', $config['class']);
        $tpl->assign('kjurl', $config['kjurl']);
		$tpl->assign('moneytype', $config['moneytype']);
		$msql->query("select kfurl from `$tb_config`");
		$msql->next_record();
		$tpl->assign('kfurl', $msql->f('kfurl'));
		
	   $tpl->assign("maxlayer",$config["maxlayer"]);
	   
        $tpl->display('top.html');
        break;
 